<input type='hidden' id='provider' value='{$sProvider}'>
<input type='hidden' id='friends_count' value='{$iCnt}'>
<input type="hidden" id="contacts" name="contacts" value="" />
<div id="openinviter">
	{if count($aJoineds)}
	{phrase var='friend.the_following_users_are_already_a_member_of_our_community'}:
	<div class="p_4">
		<div class="label_flow" style="height:100px;">
		{foreach from=$aJoineds name=users item=aUser}
			<div class="{if is_int($phpfox.iteration.users/2)}row1{else}row2{/if} {if $phpfox.iteration.users == 1} row_first{/if}" id="js_invite_user_{$aUser.user_id}">
		{if $aUser.user_id == Phpfox::getUserId()}
			{$aUser.email} - {phrase var='friend.that_s_you'}
		{else}
			{$aUser.email} - {$aUser|user}{if !$aUser.friend_id} - <a href="#?call=friend.request&amp;user_id={$aUser.user_id}&amp;width=420&amp;height=250&amp;invite=true" class="inlinePopup" title="{phrase var='profile.add_to_friends'}">{phrase var='friend.add_to_friends'}</a>{/if}
		{/if}
			</div>
		{/foreach}
		</div>
	</div>
	{/if}
	<h3>{phrase var='contactimporter.your_contacts'}</h3>
	<p class="description" style="margin-bottom: 5px;">{phrase var='contactimporter.are_not_joined_yet'}.</p>
	<br />
	<div style='display:none' id="error">
		<ul class="form-errors"><li><ul class="errors"><li id='error_content'></li></ul></li></ul>
	</div>
    <div class="clear"></div>
	<div class="wrapper-list">
        <div id="div_list_view" style="width:98%;padding-left:0px;"> 
        <table class='thTableOddRow' align='left' cellspacing='0' cellpadding='5px' style="width:100%; border:0px solid">
            <tr style='-moz-background-clip:border;-moz-background-inline-policy:continuous;-moz-background-origin:padding;background:#EDEDED none repeat scroll 0 50%;border-bottom:1px solid #C0C0C0;margin:0px auto 0;font-weight:bold;clear:both;width:80%'>
                <td align="left" width="10px">
                    <input type='checkbox' onclick="checkAll('items[]', this.checked ? 1 : 0)" title='Select/Deselect all' checked="checked">
                </td>
                <td align="left">{phrase var='contactimporter.name'}</td>
                <td align="right" width="50px" >{phrase var='contactimporter.avatar'}</td>
            </tr>
            {foreach from=$aInviteLists key=letter item=aInviteList}
                {if $aInviteList}
                <tr class="thTableOddRow">
                    <td colspan="3" class="label"><div id="letter_{$letter}" style="padding-left:5px;">{$letter}</div></td>
                </tr>
                {foreach from=$aInviteList key=i item=aInvite}
                <tr class='thTableOddRow' id="row_{$i}">
                    <td align="left">
                        <input checked="checked" type="checkbox" name="items[]" value="{$aInvite.id}" />
                    </td>
                    <td>{$aInvite.name}</td>
                    <td align="right">
                    {if $aInvite.pic eq ''}
                        <img height='30px' width='30px' src="{$sCoreUrl}module/contactimporter/static/image/nophoto_user_thumb_icon.png">
                    {else}
                        <img height='30px' width='30px' src='{$aInvite.pic}'>
                    {/if} 
                    </td>
                </tr>                
                {/foreach}
                {/if}
            {/foreach}
        </table>
        </div>
	</div>
	<div class="clear"></div>
    <div style="float:left;margin:10px;0px;position:absolute;z-index:1000;">
        {if $sLinkPrev}<a href="{$sLinkPrev}">{phrase var='contactimporter.view_number_contacts_previous' number=5000}</a> | {/if} 
        {if $sLinkNext}<a href="{$sLinkNext}">{phrase var='contactimporter.view_number_contacts_next' number=5000}</a>{/if}
    </div>
	{pager}
    <div class="clear"></div>
	<form method="post" action="{url link='contactimporter.invite'}" class="global_form" id='openinviterform' name='openinviterform' enctype="application/x-www-form-urlencoded" onsubmit="return check_select_invite();">
		<div class="form-wrapper" id="message-wrapper" style="clear:both;margin-top:5px">
			{if phpfox::getUserParam('contactimporter.hide_the_custom_invittation_message') == false}
			<div class="form-label" id="message-label" style="width: 120px;text-align: left;"><br/>
				<label class="optional" for="message" style="margin-top:5px">
					{phrase var='contactimporter.custom_message_title'}
					<textarea rows="6" cols="45" id="message" name="message">{phrase var='contactimporter.default_invite_message_text'}</textarea>
				</label>
			</div>
			{/if}
		</div>
		<span>
			<input id="send-button" class="button" type="button" value="{phrase var='contactimporter.send_invites'}" />
			{if $iCnt >= $iLimit && ($sProvider == 'facebook' || $sProvider == 'twitter')}
                <input id="sendall-button" class="button" type='button' name='send' value="{phrase var='contactimporter.send_all' contacts=$iCnt}"/>
            {/if}
            <input id="skip-button" class="button" type='button' value ="{phrase var='contactimporter.skip'} &gt;&gt;" onclick="document.getElementById('skip').submit();">
		</span>
		<h3>{phrase var='invite.send_a_custom_invitation_link'}</h3>
        {phrase var='invite.send_friends_your_custom_invitation_link_by_copy_and_pasting_it_into_your_own_email_application'}:
		<div class="p_4">
			<input type="text" name="null" value="{$sIniviteLink}" id="js_custom_link" size="40" style="width:75%;" onfocus="this.select();" onkeypress="return false;" />
		</div>		
	</form>
</div>

<form method="post" action="{url link='contactimporter'}" id="skip">	
	<input type="hidden" value="skip" name="task" />
</form>